package com.study.example.gameserver.module.ranklist.domain;

import com.sparrow.common.value.EnumValue;

import java.util.Arrays;

public enum RankType implements EnumValue {
    LEVEL(1),
    FIGHT(2);

    private final int type;
    RankType(int type) {
        this.type = type;
    }

    public static RankType of(int rankType) {
        return Arrays.stream(values()).filter(e -> e.getType() == rankType).findFirst().orElse(null);
    }

    public int getType() {
        return type;
    }

    @Override
    public int value() {
        return type;
    }
}
